<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link href="html/css/css.css" rel="stylesheet" type="text/css" />
<script Language="JavaScript" src="html/js/functions.js"></script>
<script language="javaScript" src="html/js/MzTreeView12.js"></script>
<script type="text/javascript">
// <![CDATA[


function selectSingle(id)
{
	
	if(id == 0)
	{
		msg_box('请至少选择一个');
		return false;
	}

	
	var url = 'index.php?c=category&d=edit&CategoryID=' + id;
	
	return window.location(url);
}

function delMany(id)
{

	if(id == 0)
	{
		msg_box('请至少选择一条记录');
		return false;
	}
	
	var url = 'index.php?c=category&d=delete&CategoryID=' + id;

	return msg_box("<strong style='color:#f00;'>你确定删除该分类吗？</strong>" , url);
	
	//return false;
}


function IndexDemo(str2){
	var str1 = ""
	var s = str1.indexOf(str2);
	return(s);
}

var DOM = (document.getElementById) ? 1 : 0;
var NS4 = (document.layers) ? 1 : 0;
var IE4 = 0;
if (document.all)
{
 IE4 = 1;
 DOM = 0;
}
var win = window;   
var n = 0;
function findIt() {
 if (document.getElementById("categoryname").value != "")
  findInPage(document.getElementById("categoryname").value);
}
function findInPage(str) {
var txt, i, found;
if (str == "")
 return false;
if (DOM)
{
 win.find(str, false, true);
 return true;
}
if (NS4) {
 if (!win.find(str))
  while(win.find(str, false, true))
   n++;
 else
  n++;
 if (n == 0)
  alert("未找到指定内容.");
}
if (IE4) {
 txt = win.document.body.createTextRange();

 for (i = 0; i <= n && (found = txt.findText(str)) != false; i++) {
  txt.moveStart("character", 1);
  txt.moveEnd("textedit");
 }
if (found) {
 txt.moveStart("character", -1);
 txt.findText(str);
 txt.select();
 txt.scrollIntoView();
 n++;
}
else {
 if (n > 0) {
  n = 0;
  findInPage(str);
 }
 else
  alert("未找到指定内容.");
 }
}
return false;
}
function showCategoryMenu()
{
	alert('xxxx');
}
// -->
</script>
<style>
body {font:normal 12px 宋体}
a.MzTreeview /* TreeView 链接的基本样式 */ { cursor: hand; color: #6B6B6B; margin-top: 5px; padding: 2 1 0 2; text-decoration: none; }
.MzTreeview a.select /* TreeView 链接被选中时的样式 */ { /* color: highlighttext; background-color: highlight; */}
#kkk{
	padding:5px 0px 5px 15px;
}
.MzTreeViewRow {border:none;width:100%;padding:0px;margin:0px;border-collapse:collapse; line-height:25px;}
.MzTreeViewCell0 {border-bottom:1px solid #eee;padding:0px;margin:0px;}
.MzTreeViewCell1 {border-bottom:1px solid #eee;border-left:1px solid #eee;width:250px;padding:0px 0 0 10px;margin:0px;}
</style>
</head>

<body style="height:auto;overflow-x:hidden">
<if $Msg>
<div id="msg"><img src="html/images/information.gif" width="16" height="16" align="absmiddle" /> [$Msg]</div>
</if>
<div class="top_tool">
<div>
<a href="index.php?c=category&d=add"><img src="html/images/ad_add.gif" border="0" align="absmiddle" /> 添加</a>
<a href="javascript:search_box(this);"><img src="html/images/search.gif" border="0" align="absmiddle" /> 搜索 </a>

</div>
</div>

<div class="search_box" id="search_box" style="display:none">
	<div style="clear:both"></div>
	<div class="item">
    分类名称: <input name="CategoryName" type="text" value="" id="CategoryName" />
    </div>
    <div class="item">
    <input name="" type="image" src="html/images/search_bottom.gif" style="width:auto;" align="absmiddle" onclick="javascript:findIt();" />&nbsp;&nbsp;&nbsp;(再次按搜索可以关闭搜索框)
    </div>
    <div style="clear:both"></div>
</div>

<div class="list_intro"> 
	<div class="left">[ <b>影片分类列表</b>]&nbsp;&nbsp;&nbsp;&nbsp;<a href="index.php?c=category&d=add">创建新分类</a>&nbsp;&nbsp;/&nbsp;&nbsp;<a href="javaScript:expandAll();">展开全部</a></div>
    <div class="right"><b></b></div>
    <div style="clear:both"></div>
</div>

<div class="list_menu">
<span class="checkbox"></span>
<span class="title">分类名</span>

</div>

<div id="kkk"></div>


	<script language="javascript" type="text/javascript">
	<!--
	var MzTreeViewTH="<table class='MzTreeViewRow'><tr><td class='MzTreeViewCell0'>";
	var MzTreeViewTD="\"</td><td class='MzTreeViewCell1'>分类ID：\"+ sid +\" / <a href=javascript:selectSingle('\"+ sid +\"')>编辑</a> / <a href=javascript:delMany('\"+ sid +\"')>删除</a></td></tr></table>\"";
	
	window.tree = new MzTreeView("tree");
	
	tree.icons["property"] = "property.gif";
	tree.icons["css"] = "collection.gif";
	tree.icons["event"] = "collection.gif";
	tree.icons["book"]  = "book.gif";
	tree.iconsExpand["book"] = "bookopen.gif"; //展开时对应的图片
	
	tree.setIconPath("html/images/tree/"); //可用相对路径
	tree.N["0_movie"] = "T:[$SysInfo.SiteName] - 影片分类;"
	<if $CategoryList>
	<foreach name="CategoryList" key="key" var="var">
	<if empty($var.ParentID)>
	tree.N["movie_[$var.CategoryID]"] = "T:[$var.CategoryName]([$var.Num]);url:index.php?c=movie&d=showDate&CategoryID=[$var.CategoryID]";
	<else>
	tree.N["[$var.ParentID]_[$var.CategoryID]"] = "T:[$var.CategoryName]([$var.Num]);url:index.php?c=movie&d=showDate&CategoryID=[$var.CategoryID]";
	</if>
	</foreach>
	<else>
		tree.N["root_new"] = "T:添加新的分类;url:index.php?c=category&d=add";
	</if>

	//tree.setURL("#");
	tree.wordLine = false;
	tree.setTarget("content");
	document.getElementById("kkk").innerHTML=tree.toString();
	tree.expandAll();
	
	//alert(document.getElementsByTagName("head")[0].innerHTML);
	//alert(document.getElementById("kkk").innerHTML);

	function expandAll()
	{
		return tree.expandAll();
	}
	//-->
	</script>

    
<div class="page">
   共有<b>[$Num]</b>个分类&nbsp;</div>
</div>
</body>
</html>
